package com.huage.courseplatform.satoken.model.param;


import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="用户参数",description="用户参数")
public class UserAndRolePARAM implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotEmpty(message = "id不能为空", groups = Update.class)
    @ApiModelProperty(value = "用户id(新增可以不传)",required = true)
    private String id;

    @NotEmpty(message = "用户昵称不能为空",groups = Insert.class)
    @ApiModelProperty(value = "用户昵称",required = true)
    private String userName;

    @ApiModelProperty(value = "姓名")
    private String name;


    @ApiModelProperty(value = "身份证号")
    private String idCard;

    @Email(message = "请输入正确的邮箱")
    @ApiModelProperty(value = "邮箱")
    private String email;

    @Length(max = 11, min = 11,message = "请输入正确的手机号")
    @ApiModelProperty(value = "手机号",required = true)
    private String phone;

    @ApiModelProperty(value = "微信openid凭证")
    private String openId;

    @ApiModelProperty(value = "用户头像")
    private String headImg;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "用户状态 0：账号注销，1：正常使用，2：封禁")
    private Integer status;

    @ApiModelProperty(value = "角色：1:系统管理员，2:商家，3:教师")
    @JsonProperty
    private List<String> roleList;

}
